Skip to content

Add natural-language component rerank service#2321

Merged
Mbeaulne merged 2 commits into
masterfrom
05-27-natural-language-rerank-service
Jun 5, 2026
Merged

Add natural-language component rerank service#2321
Mbeaulne merged 2 commits into
masterfrom
05-27-natural-language-rerank-service

Conversation

@Mbeaulne
Copy link
Copy Markdown
Collaborator

@Mbeaulne Mbeaulne commented May 27, 2026

Tophatting

No manual tophatting required. This PR only adds the rerank service and unit tests; UI wiring comes later.

What changed

Adds the service that asks an LLM to rerank existing component search results.

Important behavior:

  • The LLM does not search the whole component library
  • The local search index finds candidates first
  • The LLM only reranks that small candidate list
  • Unknown or invented component ids are ignored
  • Scores are clamped to a safe range

Why

This makes natural-language search better without making the model responsible for retrieval.

Test plan

  • Run pnpm exec vitest run src/services/naturalLanguageComponentSearchService.test.ts
  • Run pnpm run typecheck --pretty false
  • Confirm empty queries do not call fetch
  • Confirm hallucinated ids are filtered out

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 27, 2026

🎩 Preview

A preview build has been created at: 05-27-natural-language-rerank-service/e12b15a

@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch from 582c2ef to 6b1d4bc Compare May 27, 2026 20:29
@Mbeaulne Mbeaulne force-pushed the 05-27-agent-settings-ui branch 2 times, most recently from 38b163d to bb24190 Compare May 27, 2026 23:18
@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch from 6b1d4bc to 0213639 Compare May 27, 2026 23:18
@Mbeaulne Mbeaulne force-pushed the 05-27-agent-settings-ui branch from bb24190 to 839c5d2 Compare May 28, 2026 17:25
@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch 3 times, most recently from ef8749f to efd1f59 Compare May 28, 2026 18:40
@Mbeaulne Mbeaulne force-pushed the 05-27-agent-settings-ui branch 2 times, most recently from 496907a to 718a81a Compare May 29, 2026 14:38
@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch 2 times, most recently from 169a2f7 to f392c3b Compare May 29, 2026 14:50
@Mbeaulne Mbeaulne force-pushed the 05-27-agent-settings-ui branch from 718a81a to a07cc76 Compare May 29, 2026 14:50
@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch 3 times, most recently from 926598b to 94b985d Compare May 29, 2026 18:04
@Mbeaulne Mbeaulne force-pushed the 05-27-agent-settings-ui branch from 254c824 to 0417a6f Compare May 29, 2026 18:04
@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch from 94b985d to cca8f22 Compare June 3, 2026 13:42
@Mbeaulne Mbeaulne mentioned this pull request Jun 3, 2026
8 tasks
@Mbeaulne Mbeaulne force-pushed the 05-27-agent-settings-ui branch from 8e168da to f5acd71 Compare June 3, 2026 15:13
@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch from cca8f22 to b7a79fc Compare June 3, 2026 15:13
@Mbeaulne Mbeaulne mentioned this pull request Jun 3, 2026
8 tasks
@Mbeaulne Mbeaulne marked this pull request as ready for review June 3, 2026 15:28
@Mbeaulne Mbeaulne requested a review from a team as a code owner June 3, 2026 15:28
Copy link
Copy Markdown

@morgan-wowk morgan-wowk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🤖 AI-assisted review — one non-blocking prompt-hardening follow-up.

Comment thread src/services/naturalLanguageComponentSearchService.ts
@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch from b7a79fc to cc1eec6 Compare June 4, 2026 20:43
@Mbeaulne Mbeaulne force-pushed the 05-27-agent-settings-ui branch from f5acd71 to 6ade827 Compare June 4, 2026 20:43
@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch from cc1eec6 to 6de727b Compare June 4, 2026 20:52
@Mbeaulne Mbeaulne force-pushed the 05-27-agent-settings-ui branch from 6ade827 to 25768e9 Compare June 4, 2026 20:52
Comment thread src/services/naturalLanguageComponentSearchService.ts Outdated
Comment thread src/services/naturalLanguageComponentSearchService.ts
Comment thread src/services/naturalLanguageComponentSearchService.ts Outdated
Comment thread src/services/naturalLanguageComponentSearchService.ts
Comment thread src/services/naturalLanguageComponentSearchService.test.ts
@Mbeaulne Mbeaulne force-pushed the 05-27-agent-settings-ui branch from 25768e9 to 8cc6ede Compare June 4, 2026 21:03
@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch from 6de727b to 707a92c Compare June 4, 2026 21:03
@Mbeaulne Mbeaulne force-pushed the 05-27-agent-settings-ui branch from 8cc6ede to a2ec331 Compare June 4, 2026 21:46
@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch from 707a92c to 1959604 Compare June 4, 2026 21:46
Copy link
Copy Markdown
Collaborator Author

Mbeaulne commented Jun 5, 2026

Merge activity

  • Jun 5, 2:37 PM UTC: A user started a stack merge that includes this pull request via Graphite.
  • Jun 5, 2:53 PM UTC: Graphite rebased this pull request as part of a merge.
  • Jun 5, 2:56 PM UTC: @Mbeaulne merged this pull request with Graphite.

@Mbeaulne Mbeaulne changed the base branch from 05-27-agent-settings-ui to graphite-base/2321 June 5, 2026 14:47
@Mbeaulne Mbeaulne changed the base branch from graphite-base/2321 to master June 5, 2026 14:51
Mbeaulne and others added 2 commits June 5, 2026 14:52
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@Mbeaulne Mbeaulne force-pushed the 05-27-natural-language-rerank-service branch from 304d368 to e12b15a Compare June 5, 2026 14:52
@Mbeaulne Mbeaulne merged commit 7e411be into master Jun 5, 2026
17 checks passed
@Mbeaulne Mbeaulne deleted the 05-27-natural-language-rerank-service branch June 5, 2026 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants